package com.bxl.netty.rpc.client;

import com.bxl.netty.rpc.client.common.pool.ZoneClientPool;
import com.bxl.netty.rpc.client.context.ClientContext;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * <>
 *
 * @author baixl
 * @date 2021/2/24
 */
public class LocalRpcClientFactory implements RpcClientFactory {

    private ClientContext context;
    private ZoneClientPool clientPool;

    public LocalRpcClientFactory(ClientContext context) {
        this.context = context;
        this.clientPool = this.context.getClientPool();
    }

    public LocalRpcClientFactory() {

    }

    public NioSocketChannel getClient(String zoneId) {
        return clientPool.getClientWaitInit(zoneId);
    }
}
